#ifndef __Timer_h
#define __Timer_h
#define SYSTEM_TIMER
#define WINDOWS_SYSTEM
#ifdef CUDA_TIMER
#define CREATE_TIMER     cudaEvent_t start, stop;\
    float elapsedTime;
#define START_TIMER cudaEventCreate (&start);\
    cudaEventCreate(&stop);\
    cudaEventRecord(start, 0);

#define STOP_TIMER(result) cudaEventRecord(stop, 0);\
    cudaEventSynchronize(stop);\
    cudaEventElapsedTime(&result, start, stop);

#define DESTORY_TIMER cudaEventDestroy(start);\
    cudaEventDestroy(stop);
#endif
#ifdef CLOCK_TIMER
#endif
#ifdef SYSTEM_TIMER
#ifdef WINDOWS_SYSTEM
#include <windows.h>
#define CREATE_TIMER     LARGE_INTEGER li; LONGLONG start, end, freq; \
    float elapsedTime;\
     QueryPerformanceFrequency(&li); \
    freq = li.QuadPart;\

#define START_TIMER QueryPerformanceCounter(&li); \
    start = li.QuadPart;

#define STOP_TIMER(result) QueryPerformanceCounter(&li); \
    end = li.QuadPart;\
    result = (float)((end - start) * 1000 / freq);
#define DESTORY_TIMER 
#endif//WINDOWS_SYSTEM
#ifdef LINUX_SYSTEM
#include <<sys/time.h>
#define CREATE_TIME  struct timeval start, end;\
	float elapsedTime;
#define START_TIMER  gettimeofday( &start, NULL );
#define STOP_TIMER(result)   gettimeofday( &end, NULL );\
	result = 1000000 * ( end.tv_sec - start.tv_sec ) + end.tv_usec -start.tv_usec;\
	result = result/1000000;
#endif//LINUX_SYSTEM
#endif//SYSTEM_TIMER
#endif